package it.eng.area118.mdocommon.android.animation;

import android.view.animation.Animation;
import android.view.animation.LinearInterpolator;
import android.view.animation.LinearInterpolator;
import android.view.animation.TranslateAnimation;

public class SlideAnimations {

	public static TranslateAnimation inFromRight;
	private static TranslateAnimation outtoLeft;
	private static TranslateAnimation inFromLeft;
	private static TranslateAnimation outtoRight;
	private static TranslateAnimation inFromUp;
	private static TranslateAnimation outToUp;
	private static TranslateAnimation inFromDown;
	private static TranslateAnimation outToDown;

	public static Animation inFromRight() {
		inFromRight = new TranslateAnimation(Animation.RELATIVE_TO_PARENT,
				-1.0f, Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f);
		inFromRight.setDuration(800);
		inFromRight.setInterpolator(new LinearInterpolator());
		return inFromRight;
	}

	public static Animation outToLeft() {
		outtoLeft = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, -1.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f);
		outtoLeft.setDuration(800);
		outtoLeft.setInterpolator(new LinearInterpolator());
		return outtoLeft;
	}

	public static Animation inFromLeft() {
		inFromLeft = new TranslateAnimation(Animation.RELATIVE_TO_PARENT,
				+1.0f, Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f);
		inFromLeft.setDuration(800);
		inFromLeft.setInterpolator(new LinearInterpolator());
		return inFromLeft;
	}

	public static Animation outToRight() {
		outtoRight = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, +1.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f);
		outtoRight.setDuration(800);
		outtoRight.setInterpolator(new LinearInterpolator());
		return outtoRight;
	}

	public static Animation inFromUp() {
		inFromUp = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, +1.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f);
		inFromUp.setDuration(800);
		inFromUp.setInterpolator(new LinearInterpolator());
		return inFromUp;
	}

	public static Animation outToUp() {
		outToUp = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, -1.0f);
		outToUp.setDuration(800);
		outToUp.setInterpolator(new LinearInterpolator());
		return outToUp;
	}

	public static Animation inFromDown() {
		inFromDown = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, -1.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f);
		inFromDown.setDuration(800);
		inFromDown.setInterpolator(new LinearInterpolator());
		return inFromDown;
	}

	public static Animation outToDown() {
		outToDown = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,
				Animation.RELATIVE_TO_PARENT, +1.0f);
		outToDown.setDuration(800);
		outToDown.setInterpolator(new LinearInterpolator());
		return outToDown;
	}

}
